import { createRouter, createWebHistory } from 'vue-router'
import Layout from '../Layout.vue'
const router = createRouter({
  // history: createWebHistory(import.meta.env.BASE_URL),
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: Layout,
      alias: '/layout',
      children: [
        {
          path: 'user_list',
          name: 'user_list',
          component: () => import('../views/use/ListView.vue'),
        },
        {
          path: 'banner_add',
          name: 'banner_add',
          component: () => import('../views/banner/AddView.vue'),
        },
        {
          path: 'banner_list',
          name: 'banner_list',
          component: () => import('../views/banner/ListView.vue'),
        },
        {
          path: 'navi_add',
          name: 'navi_add',
          component: () => import('../views/navi/AddView.vue'),
        },
        {
          path: 'navi_list',
          name: 'navi_list',
          component: () => import('../views/navi/ListView.vue'),
        },
        {
          path: 'photo',
          name: 'photo',
          component: () => import('../views/use/PhotoView.vue'),
          children: [
            {
              path: 'detail',
              name: 'detail',
              component: () => import('../views/use/DetailView.vue'),
            },
          ],
        },
        {
          path: 'setting',
          name: 'setting',
          component: () => import('../views/use/SettingView.vue'),
        },
      ],
    },
    {
      path: '/search',
      name: 'search',
      component: () => import('../views/navi/SearchResult.vue'),
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('../views/HomeView.vue'),
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/LoginView.vue'),
    },
    {
      path: '/admin',
      name: 'admin',
      component: () => import('../views/AdminView.vue'),
    },
  ],
})

export default router
